Next (fld)

Crystal syntax.

Next and NextValue (fld) are equivalent functions. However, you can use Next only with Crystal syntax, and NextValue (fld) only with Basic syntax.

Arguments

fld is any valid database field or formula field.

Returns

A field value of the same type as the argument.

Action

Next(fld) returns the value of the specified field for the next record.

Typical uses

You can use Next to identify the first or last record in a range, to identify the starting point for a new group, or to test for duplicate values.

Examples

The following examples are applicable to Crystal syntax:

If Next({file.QTY})<>0 Then

    {file.QTY}/2

Else

    {file.QTY}

Tests the next value in the {file.QTY} field to see if it is a zero value. If it is not, it divides the value by two. If it is a zero value, it returns the value itself.

If Remainder(Next ({file.SERIALNUM}), 300) = 0 Then

    "End of block"

Else

    ""

Divides the next value in the {file.SERIALNUM} field by 300. If there is no remainder, it flags the current value as "End of block". If there is a remainder (Else) it prints no flag. (This formula divides serial numbers into blocks of 300.)

Note:    Using this function in a formula forces the formula to be evaluated at print time. For more information on evaluation time considerations, see Evaluation Time functions.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com